Skip to content

feat: local auto-login + eigent.ai callback for Electron hybrid login#1497

Merged
4pmtong merged 2 commits into
mainfrom
feat/local-auto-login
Mar 16, 2026
Merged

feat: local auto-login + eigent.ai callback for Electron hybrid login#1497
4pmtong merged 2 commits into
mainfrom
feat/local-auto-login

Conversation

@4pmtong
Copy link
Copy Markdown
Collaborator

@4pmtong 4pmtong commented Mar 14, 2026

Related Issue

Closes #

Description

Redesign the login flow based on deployment mode:

Fully Local Mode (VITE_USE_LOCAL_PROXY=true):

  • Add /api/auto-login backend endpoint that returns the most recently active user or creates a default admin user
  • Login page shows a "Start Eigent" button instead of email/password form
  • Route guard auto-logs in when no token is present
  • Default model type set to custom (not cloud) to avoid confusion
  • Skip onboarding carousel/install screen after auto-login

Hybrid/App Mode (VITE_USE_LOCAL_PROXY=false):

  • Login page redirects to eigent.ai/signin for authentication (decoupled from local auth)
  • Electron main process starts a local HTTP server to receive auth callbacks with token
  • Dev mode uses http://localhost callback; production uses eigent:// custom protocol
  • After receiving token, fetches user profile from /api/user to populate username/email
  • SignUp page redirects to eigent.ai/signup

Other changes:

  • LoginResponse model adds optional redirect_url field (synced with eigent_server)
  • History.tsx: Fix welcome name fallback (|| instead of ?? for empty string handling)

Testing Evidence (REQUIRED)

App Mode
CleanShot 2026-03-15 at 15 04 03

  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@4pmtong 4pmtong marked this pull request as draft March 14, 2026 18:11
@4pmtong 4pmtong marked this pull request as ready for review March 15, 2026 03:25
Copy link
Copy Markdown
Contributor

@Douglasymlai Douglasymlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@4pmtong 4pmtong merged commit bebd1aa into main Mar 16, 2026
13 checks passed
@fengju0213 fengju0213 added this to the Sprint 19 milestone Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants